package com.oa.srms.apps.dao.student.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.oa.srms.apps.dao.student.IFamilyInfoDao;
import com.oa.srms.apps.entity.student.FamilyInfoValue;

public class FamilyInfoDaoImpl extends HibernateDaoSupport implements IFamilyInfoDao {

	@Override
	public Integer addFamilyInfo(FamilyInfoValue familyInfoValue)
			throws Exception {
		if(familyInfoValue != null){
			this.getHibernateTemplate().save(familyInfoValue);
		}
		return familyInfoValue.getId();
	}

	@Override
	public void editFamilyInfo(FamilyInfoValue familyInfoValue)
			throws Exception {
		if(familyInfoValue != null){
			this.getHibernateTemplate().update(familyInfoValue);
		}

	}

	@Override
	public FamilyInfoValue queryById(Integer id) throws Exception {
		return (FamilyInfoValue) this.getHibernateTemplate().get(FamilyInfoValue.class, id);
	}

	@Override
	public List<FamilyInfoValue> queryFamilyInfo() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

}
